#include<bits/stdc++.h>
using namespace std;
int main()
{
	int s,v,h,m;
	double t;
	cin>>s>>v;
	t=s*1.0/v+8;
	t=ceil(t);
	h=t/60;
	m=(int)t%60;
	h=m>0?7-h:8-h;
	m=60-m;
	printf("%02d:%02d",h,m);
    return 0;
}
